package structure.decorator;

/**
 * @author lzp
 * @Date:2023/2/24
 * @description: 装饰器测试案例
 */
public class DecoratorDemo {

	public static void main(String[] args) {
		TextNode node1 = new SpanNode();
		TextNode node2 = new BoldDecorator(new SpanNode());
		TextNode node3 = new UnderlineDecorator(new BoldDecorator(new SpanNode()));

		node1.setText("有点东西");
		node2.setText("很多东西");
		node3.setText("超多东西");

		System.out.println(node1.getText());
		System.out.println(node2.getText());
		System.out.println(node3.getText());
	}

}
